package com.quwan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.quwan.app.vo.CommentFollow;
import com.quwan.entity.TDynamicComment;
import com.quwan.manager.controller.dto.DynamicCommentDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author quan
 * @date 2021-07-24 17:08
 */


public interface TDynamicCommentMapper extends BaseMapper<TDynamicComment> {

    @Select("select  count(id) as c ,comment_id  from t_comment_follow where comment_id in (${ids}) and status =1  group  by comment_id")
    List<CommentFollow> selectFollowCountById(String ids);

    @Select("select  count(un_lock) as c ,comment_id  from t_comment_follow where un_lock in (${unLocks}) and status =1 group  by comment_id")
    List<CommentFollow>   selectMemberFollowComment(String unLocks);


    //后台查询接口
    Page<DynamicCommentDto> selectManageDynamicCommentList(Page<DynamicCommentDto> page, @Param("dynamicId") String dynamicId, @Param("mId") String mId, @Param("memberName") String memberName, @Param("content") String content, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

}